home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 1814 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  1.7 KB

  1. Path: newsfeed.internetmci.com!xmission!news
  2. From: tknarr@xmission.com  ( Todd Knarr )
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: C++  Vs. C  & Efficiency
  5. Date: 13 Jan 1996 02:34:28 GMT
  6. Organization: Chaos Central
  7. Message-ID: <4d75nk$c12@news.xmission.com>
  8. References: <4d5qg1$3fa@news1.usa.pipeline.com> <30F705F9.403F@iastate.edu>
  9. Reply-To: tknarr@xmission.com ( Todd Knarr )
  10. NNTP-Posting-Host: slc50.xmission.com
  11. X-Newsreader: IBM NewsReader/2 v1.2
  12.  
  13. In <30F705F9.403F@iastate.edu>, Steve Lee <sjlee@iastate.edu> writes:
  14. >
  15. >What about the overhead incurred with exception handling and templates?  Also,
  16.  
  17. There's no overhead to exception handling unless you use it. As for templates,
  18. they have precisely the same overhead as an ordinary class.
  19.  
  20. >doesn't object-oriented programming (referring to C++) tend to have more function
  21. >call overhead than structured programming (referring to C)?
  22.  
  23. Depending on how you write it. Judicious use of inline member functions can
  24. reduce the function-call overhead in the cases where it matters without
  25. sacrificing type-checking in the process.
  26.  
  27. As for performance, I've found that in most cases the extra overhead does
  28. not kill performance. Stupid selection of algorithms and overall concept
  29. does far more damage. Generally I consider it something to worry about after
  30. I've got it compiled, debugged and running clean and can accurately time and
  31. profile it.
  32.  
  33. --
  34. Todd Knarr : tknarr@xmission.com      |  finger for PGP public key
  35.                                       |  Member, USENET Cabal
  36.  
  37. Seriously, I don't want to die just yet.  I don't care how
  38. good-looking they are, I! don't! want! to! die!"
  39.                                         -- Megazone ( UF1 )
  40.  
  41.